#!/bin/bash
#
#********************************************************************
#Author:                songliangcheng
#QQ:                    2192383945
#Date:                  2023-02-19 22:14:42
#FileName：             reset-kubernetes.sh
#URL:                   http://blog.mykernel.cn
#Description：          test script
#Copyright (C):        2023 All rights reserved
#********************************************************************
rm -fr /etc/kubernetes/ ~/.kube/
docker container kill $(docker ps -a -q)
docker container rm $(docker ps -a -q)
systemctl stop kubelet
 mount | grep '/var/lib/kubelet/' | awk '{print $3}' | xargs -L1 umount
rm -rf /etc/kubernetes/ /var/lib/etcd /var/lib/kubelet /var/lib/dockershim /var/run/kubernetes /var/lib/cni  /etc/cni/net.d
ipvsadm --clear
ip link delete cni0
ip link delete  flannel.1

